//
//  Bridge.m
//  app
//
//  Created by yanjunliang on 2024/3/15.
//

#import "Bridge.h"

@implementation Bridge

- (void)playMusic:(id)params {
    NSLog(@"ios recive playMusic fun");
    NSString *paramsString = (NSString *)params;
    NSData *data = [paramsString dataUsingEncoding:NSUTF8StringEncoding];
    NSError *error;
    NSDictionary *paramsDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error];
    NSString *path = [paramsDic objectForKey:@"path"];
    if (path == nil || [@"" isEqualToString:path]) {
        NSLog(@"ios recive playMusic fun path is nil");
        return;
    }
    if (self.funListen) {
        [self.funListen BridgeArkUICallMathPlay:path];
    }
}

- (void)stop:(id)params {
    if (self.funListen) {
        [self.funListen BridgeArkUICallMathStop];
    }
}

@end
